<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserInfo.aspx.cs" Inherits="_UserInfo" %>

<%@ Register Src="../../../Control/PageNo.ascx" TagName="PageNo" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会员管理</title>
    <link rel="stylesheet" href="../../skin/style.css" type="text/css" />

    <script type="text/javascript">
    
     function checkbox1(){
        // 找到所有的 input 元素
        var ctllist = document.getElementsByTagName("input");
        var chec=false;             
        for( var i = 0; i< ctllist.length; i++){
            if( ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0){
                if(ctllist[i].checked==true){
                    chec=true;  
                }
            }           
        }
        if(chec==false){
            alert("请至少选择一项");
            return false;
        }else
        {
           return confirm("确定要将选择的会员删除吗？");
        }    
    }  
         function checkbox2(){
        // 找到所有的 input 元素
        var ctllist = document.getElementsByTagName("input");
        var chec=false;             
        for( var i = 0; i< ctllist.length; i++){
            if( ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0){
                if(ctllist[i].checked==true){
                    chec=true;  
                }
            }           
        }
        if(chec==false){
            alert("请至少选择一项");
            return false;
        }else
        {
           return confirm("确定要将选择的会员通过审核吗？");
        }    
    }  
     function checkbox3(){
        // 找到所有的 input 元素
        var ctllist = document.getElementsByTagName("input");
        var chec=false;             
        for( var i = 0; i< ctllist.length; i++){
            if( ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0){
                if(ctllist[i].checked==true){
                    chec=true;  
                }
            }           
        }
        if(chec==false){
            alert("请至少选择一项");
            return false;
        }else
        {
           return confirm("确定要将选择的会员未通过审核吗？");
        }    
    }                
    </script>

</head>

<script type="text/javascript" src="../../../js/jquery.js"></script>

<body>
    <form id="form1" runat="server">
        <div class="itemtitle">
            <h3>
                操作提示</h3>
        </div>
        <div class="itemtitle_tect">
            <p>
                会员名：<asp:TextBox ID="txtLoginName" runat="server"></asp:TextBox>
                &nbsp;单位名：
                <asp:TextBox ID="txtCompanyName" runat="server"></asp:TextBox>
                &nbsp;会员等级：
                <asp:DropDownList ID="txtGrade" runat="server">
                </asp:DropDownList>
                <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="立即查询" CssClass="i_button" />
            </p>
        </div>
        <div class="partition">        
            <div class="Option">
                <asp:Label ID="Label5" runat="server"><strong>快捷操作</strong></asp:Label>
                <asp:Label ID="Label1" runat="server"><a href="?v=0">所有信息</a></asp:Label>
                <asp:Label ID="Label2" runat="server"><a href="?v=1">已审核信息</a></asp:Label>
                <asp:Label ID="Label3" runat="server"><a href="?v=2">未审核信息</a></asp:Label>
            </div>
        </div>
        <div class="talbe_border">
            <asp:GridView ID="grdUser" runat="server" AutoGenerateColumns="False" CellPadding="0"
                BorderStyle="None" DataKeyNames="UserID" OnRowDataBound="grdUser_RowDataBound"
                GridLines="None" AllowPaging="False" CssClass="talbe_list">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                            <asp:Label ID="lblUserID" runat="server" Text='<%# Eval("UserID") %>' Visible="false"></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle CssClass="th20 tou" />
                        <ItemStyle CssClass="nolet" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="会员名">
                        <ItemStyle CssClass="th75" />
                        <ItemTemplate>
                            <a href="LoginInfoEdit.aspx?UserID=<%# Eval("UserID") %>">
                                <%# Eval("LoginName")%>
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="会员等级" >
                        <ItemStyle CssClass="th75"  />
                        <ItemTemplate>
                                <%# Eval("Name")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="CompanyName" HeaderText="单位名称">
                        <HeaderStyle CssClass="th75" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="服务开始时间">
                        <ItemTemplate>
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem, "StartDate").ToString())%>
                        </ItemTemplate>
                        <HeaderStyle CssClass="th80" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="服务截至时间">
                        <ItemTemplate>
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem, "EndDate").ToString())%>
                        </ItemTemplate>
                        <HeaderStyle CssClass="th80" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="锁定">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtnUpdateLockedup" Font-Underline="false" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Lockedup").ToString()== "True" ? "已锁定" : "未锁定"%>'
                                CommandArgument='<%# DataBinder.Eval(Container.DataItem, "UserID")+"|"+DataBinder.Eval(Container.DataItem, "Lockedup")%>'
                                OnCommand="lbtnUpdateLockedup_Command"></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle CssClass="th25" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="审核">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtnUpdate" Font-Underline="false" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Verify").ToString()== "True" ? "已审" : "未审"%>'
                                CommandArgument='<%# DataBinder.Eval(Container.DataItem, "UserID")+"|"+DataBinder.Eval(Container.DataItem, "Verify")%>'
                                OnCommand="lbtnUpdate_Command"></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle CssClass="th25" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <a href='UserEdit.aspx?UserID=<%# DataBinder.Eval(Container.DataItem, "UserID")%>'>编辑
                            </a>|
                            <asp:LinkButton CommandName="delete" ID="lnkdelete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "UserID") %>'
                                OnCommand="lnkdelete_Command" runat="server" Text="删除" OnClientClick="return confirm('你确定要删除吗?')"></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle CssClass="th80" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="header" />
            </asp:GridView>
            <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
            <div class="Paging">
             <p>
                <uc1:PageNo ID="PageNo1" runat="server" /></p>
                <input id="CheckBox2" name="CheckBox2" type="checkbox" onclick="SelectAll();" />全选
                <asp:Button ID="btnDelete" runat="server" Font-Size="9pt" Text="批量删除" OnClientClick="return checkbox1();" OnClick="btnDelete_Click"
                    CssClass="i_button" />
                <asp:Button ID="Button1" runat="server" Font-Size="9pt" OnClientClick="return checkbox2();"
                    Text="审核通过" CssClass="i_button" OnClick="Button1_Click" />
                <asp:Button ID="Button2" runat="server" Font-Size="9pt" OnClientClick="return checkbox3();"
                    Text="审核未通过" CssClass="i_button" OnClick="Button2_Click" />
            </div>
        </div>
    </form>
</body>
</html>
